package com.gzhryc.shared_device.oem.code.agent.dao.db;

import com.gzhryc.jdbc.annotaion.*;
import com.gzhryc.shared_device.oem.code.user.dao.db.User;

import java.util.Date;

@Table(name="agent_info")
public class Agent {

    @Id(auto = false)
    @Column(name = "user_id",note = "用户ID")
    protected Long userId;

    @Column(notNull = true,defVal = "1",note = "级别")
    protected Integer level;

    @Column(name="service_charge_ratio",notNull = true,note = "服务费比例")
    protected Double serviceChargeRatio;
    
    @Column(name="last_login_date",note = "最后登录时间")
    protected Date lastLoginDate;

    @Column(name = "update_date", autoUpdateTime = true)
    protected Date updateDate;

    @Column(name = "create_date")
    protected Date createDate;

    @Join(fromField = "user_id")
    protected User user;

    @JoinField(name = "name",fromField = "level",toTable = "agent_level",toField = "num",type = "LEFT")
    protected String levelName;

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Integer getLevel() {
        return level;
    }

    public void setLevel(Integer level) {
        this.level = level;
    }

    public Double getServiceChargeRatio() {
        return serviceChargeRatio;
    }

    public void setServiceChargeRatio(Double serviceChargeRatio) {
        this.serviceChargeRatio = serviceChargeRatio;
    }

    public Date getLastLoginDate() {
		return lastLoginDate;
	}

	public void setLastLoginDate(Date lastLoginDate) {
		this.lastLoginDate = lastLoginDate;
	}

	public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public String getLevelName() {
        return levelName;
    }

    public void setLevelName(String levelName) {
        this.levelName = levelName;
    }

}
